﻿namespace zijian666.Data.Extensions;
public static class StringExtensions
{
    [return: NotNullIfNotNull("str")]
    public static string? ToFullLike(this string? str)
    {
        if (str is null)
        {
            return null;
        }
        return $"%{str}%";
    }
    [return: NotNullIfNotNull("str")]
    public static string? ToLeftLike(this string? str)
    {
        if (str is null)
        {
            return null;
        }
        return $"{str}%";
    }
    [return: NotNullIfNotNull("str")]
    public static string? ToRightLike(this string? str)
    {
        if (str is null)
        {
            return null;
        }
        return $"%{str}";
    }
}
